home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Source / MacTech® Magazine / Volume 04 - 1988 / 04.04 Apr 88 / forth sources / application ghosts (MPW) next >
Encoding:
Text File  |  1988-03-07  |  470 b   |  15 lines  |  [TEXT/EDIT]

  1.         INCLUDE    'traps.a'
  2. ghost    MAIN
  3.         MOVE.W    #0,-(SP)        ; the context data (_launch parameter)
  4.         MOVE.L    #'STR ',-(SP)    ; 1st parameter of GetResource
  5.         MOVE.W    #1000,-(SP)        ; 2nd parameter of GetResource
  6.         _GetResource            ; handle to string in (SP)
  7.         TST.L    (SP)            ; test if null handle (no resource available)
  8.         BEQ.B    exit            ; if null, go to exit
  9.         MOVE.L    (SP),A0
  10.         MOVE.L    (A0),(SP)        ; handle dereferenced
  11.         MOVE.L    SP,A0            ; stack pointer in A0
  12.         _Launch
  13. exit    _ExitToShell
  14.         END
  15.